boxlayout: Compute opposite size properly
authorBenjamin Otte <otte@redhat.com>
Fri, 5 Nov 2021 19:30:49 +0000 (20:30 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 5 Nov 2021 19:30:49 +0000 (20:30 +0100)
commit5c9ae289373b967ba395fbe562c6db4c83e6415c
tree85caa25eb6a3ac7bfdf279b828c9a82851f8b04e
parent8e27fc7f9b0f34880bdb3650ba141ad65883c094
boxlayout: Compute opposite size properly

For size -1 in the opposite orientation, GtkBoxLayout used to measure
the children based on their min size in the box's orientation instead of
-1. That wasn't really intended, but was a side effect of how the sizing
code did (not) distribute extra size above the minimum size.

This is clearly not what we want.
What we want is measuring the orientation as is for size -1. Then we
want to just take the maximum of all children and use that.

A reftest is incldued that ensures a vbox wraps a label just like an
hbox does.
gtk/gtkboxlayout.c
testsuite/reftests/meson.build
testsuite/reftests/vbox-with-max-width-chars-label.ref.ui [new file with mode: 0644]
testsuite/reftests/vbox-with-max-width-chars-label.ui [new file with mode: 0644]